﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHP TEST</title></head>
<body>

<?php
session_start();
$id=$_SESSION["UserName"];
$dsn = 'mysql:dbname=orb;host=localhost';
$user = 'root';
$password = '';

try{
    $dbh = new PDO($dsn, $user, $password);

    print('接続に成功しました<br>');

    //$sql = 'select * from Notes ORDER BY RatedCount ASC , NoteId WHERE UserName NOT IN (".$_SESSION["NickName"].")';
    $sql = 'select * from Accounts WHERE UserName NOT IN ("'.$id.'")';
    $Users = $dbh->query($sql);
    foreach ($Users as $row) {
        print($row['UserName']);
        print($row['Password'].'<br>');
   }
}catch (PDOException $e){
    print('Connection failed:'.$e->getMessage());
    die();
}


$pdo = null;
?>
</body>
</html>
